/**
 * 是否显示课时时间
 * @param subjects
 * @param timetable
 * @param classtime
 * @param istime
 * @returns {Array}
 */
export var t = (subjects, timetable, classtime, istime)=> {
    var class_num = {
        1: {
            en: 'one',
            cn: '一'
        },
        2: {
            en: 'two',
            cn: '二'
        },
        3: {
            en: 'three',
            cn: '三'
        },
        4: {
            en: 'four',
            cn: '四'
        },
        5: {
            en: 'five',
            cn: '五'
        },
        6: {
            en: 'six',
            cn: '六'
        },
        7: {
            en: 'seven',
            cn: '七'
        },
        8: {
            en: 'eight',
            cn: '八'
        },
        9: {
            en: 'nine',
            cn: '久'
        },
        10: {
            en: 'ten',
            cn: '十'
        },
    };
    // var subjects = nextProps[md5Url.SCHEDULE_GET].list.subject;
    // var timetable = nextProps[md5Url.SCHEDULE_GET].list.timetable;
    // var classtime = nextProps[md5Url.SCHEDULE_GET].list.classtime;
    subjects = _.isArray(subjects) ? subjects : [];
    timetable = _.isArray(timetable) ? timetable : [];
    classtime = _.isArray(classtime) ? classtime : [];

    var schedule_body = [];
    classtime.slice(0, 10).forEach((item, index)=> {
        schedule_body.push([]);
        _.range(0, 8).map((it)=> {

            if (it == 0) {
                schedule_body[index][it] = {
                    text: (
                        <div>
                            <b>第{class_num[index + 1].cn}节</b><br/>
                            {istime ? <small>{item.starttime}~{item.endtime}</small> : ''}
                        </div>
                    ),
                    type: 'time'
                }
            } else {
                schedule_body[index][it] = {
                    text: '' + timetable[it - 1][class_num[index + 1].en + 'text'],
                    id: timetable[it - 1][class_num[index + 1].en]
                }
            }
        });
    });

    if (timetable.length) {
        schedule_body = [
            ...schedule_body.slice(0, 4),
            {
                text: '午休',
                type: 'column'
            },
            ...schedule_body.slice(4)
        ]
    }
    return schedule_body;
};